<?php
/**
 * Created by PhpStorm.
 * User:吴鑫
 */

namespace mobile\service;

use common\models\Evalu;
use common\service\ConstatService;
use yii\data\Pagination;
use yii\db\Query ;
use Yii ;

class EvaluService
{

    /**
     * 评价列表
     */
    public static function findEvaluList(){
        $pages = null ;
        $query = new Query();

        $query->select('*')
            ->from(Evalu::tableName())
            ->andWhere(["status"=>ConstatService::EVALU_STATUS_ENABLE])
            ->orderBy("id desc") ;

        $list = $query->all() ;

        $arr = [] ;
        foreach($list as $key=>$val){
            $id = $val['id'] ;
            $title = $val['title'] ;
            $contentArr = explode("|",$val['content']) ;
            $arr[] = ["id"=>$id,"title"=>$title,"contentArr"=>$contentArr] ;
        }

        return $arr;

    }


}